import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        errors: {}
    },
    mutations: {

        setErrors(state, errors) {
            let newErrors={}
           Object.entries(errors).map(([k,v])=>{
               newErrors[k]=v.pop()
            })

            state.errors=newErrors
        }
    }
})
